﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApp1.Models
{
    public class WebUser
    {

        public WebUser()
        {

        }

        public WebUser(bool isGuestUser)
        {
            WebUser wb = new WebUser();

            if (isGuestUser == true)
            {

            }
        }
        public string UserName { get; set; }
        public string UserID { get; set; }
        public string IsGuestUser { get; set; }


        public WebUser DetectUserFromRequest(HttpContext httpContext)
        {
            if (httpContext == null || httpContext.Request == null)
            {
                throw new ApplicationException("Invalid http context or http request.");
            }

            if (httpContext.Request.Cookies.Count > 0 && httpContext.Request.Cookies.Get("wu") != null)
            {
                string userId = httpContext.Request.Cookies.Get("wu").Value;

                if (userId.StartsWith("tmp-"))
                {
                    
                }

            }
            else
            {
                // now we need to issue the 
            }

            return new WebUser(true);

        }



    }


}